package com.ruoyi.lock.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lock.mapper.AProblemsMapper;
import com.ruoyi.lock.domain.AProblems;
import com.ruoyi.lock.service.IAProblemsService;

/**
 * 常见问题Service业务层处理
 * 
 * @author arvin
 * @date 2025-03-22
 */
@Service
public class AProblemsServiceImpl implements IAProblemsService 
{
    @Autowired
    private AProblemsMapper aProblemsMapper;

    /**
     * 查询常见问题
     * 
     * @param id 常见问题主键
     * @return 常见问题
     */
    @Override
    public AProblems selectAProblemsById(Long id)
    {
        return aProblemsMapper.selectAProblemsById(id);
    }

    /**
     * 查询常见问题列表
     * 
     * @param aProblems 常见问题
     * @return 常见问题
     */
    @Override
    public List<AProblems> selectAProblemsList(AProblems aProblems)
    {
        return aProblemsMapper.selectAProblemsList(aProblems);
    }

    /**
     * 新增常见问题
     * 
     * @param aProblems 常见问题
     * @return 结果
     */
    @Override
    public int insertAProblems(AProblems aProblems)
    {
        aProblems.setCreateTime(DateUtils.getNowDate());
        return aProblemsMapper.insertAProblems(aProblems);
    }

    /**
     * 修改常见问题
     * 
     * @param aProblems 常见问题
     * @return 结果
     */
    @Override
    public int updateAProblems(AProblems aProblems)
    {
        aProblems.setUpdateTime(DateUtils.getNowDate());
        return aProblemsMapper.updateAProblems(aProblems);
    }

    /**
     * 批量删除常见问题
     * 
     * @param ids 需要删除的常见问题主键
     * @return 结果
     */
    @Override
    public int deleteAProblemsByIds(Long[] ids)
    {
        return aProblemsMapper.deleteAProblemsByIds(ids);
    }

    /**
     * 删除常见问题信息
     * 
     * @param id 常见问题主键
     * @return 结果
     */
    @Override
    public int deleteAProblemsById(Long id)
    {
        return aProblemsMapper.deleteAProblemsById(id);
    }
}
